revMail
Type
command
Summary
Opens a new email message in the user's email program.
Syntax
revMail <address>, [<ccAddress>, [<mailSubject>, [<messageBody>]]]
Description
Use the revMail command to create an email message from within a stack.
When LiveCode executes the revMail command, the user's email program is opened (if necessary) and a new email message with the specified parameters is created. The user can change any of the settings before sending the message, and the message is not sent automatically: the user must explicitly send it (for example, by clicking a 'Mail' button in the email program).
On Mac OS systems, the mail message is opened in the application the user has set for the 'mailto:' protocol in the Internet control panel (or, for older system versions, Internet Config).
On iOS, revMail hooks into the iOS MessageUI framework.
On Mac OS systems, the revMail command requires that AppleScript be installed and that the GURL Apple Event be supported. GURL support is included in Mac OS 8.5 or later, and is available for Mac OS 8.0 and 8.1 if the Internet Scripting file is installed in the Scripting Additions folder inside the Extensions folder. (This file is installed by the Internet Access installer on the 8.0 installation CD.) The revMail command is not supported for Mac OS versions before 8.0.
For some older email programs, it may not be possible to specify a ccAddress, mailSubject, or messageBody. Generally, the revMail command still works with such programs, but only the 'To:' header is set.
When included in a standalone application, the Common library is implemented as a hidden group and made available when the group receives its first openBackground message. During the first part of the application's startup process, before this message is sent, the revMail command is not yet available. This may affect attempts to use this command in startup, preOpenStack, openStack, or preOpenCard handlers in the main stack. Once the application has finished starting up, the library is available and the revMail command can be used in any handler.
Once the revMail command is called, you have no more control over what the user does with the message. They are free to modify the message and the addresses as they see fit.
Parameters
Name | Type | Description |
---|---|---|
address | string | A string consisting of one or more email addresses, separated by commas. These addresses appear in the 'To:' header of the email message. |
ccAddress | string | A string consisting of one or more email addresses, separated by commas. These addresses appear in the 'Cc:' header of the email message. |
mailSubject | string | A string consisting of a single line. This text appears in the 'Subject:' header of the email message. |
messageBody | string | This text appears in the 'body' of the email message. |
Examples
revMail "guido@example.net"
revMail "help@example.com",,"Help!",field "Message"
revMail "support@livecode.com","me@example.org","Installation Help"
revMail the bugAddress of this stack,,"Auto Bug Report",myBugsList
Related
object: stack
command: mobileComposeUnicodeMail, revGoURL, revMailUnicode, mobileComposeMail, mobileComposeHtmlMail
glossary: parameter, main stack, handler, message, group, Mac OS, standalone application, Apple Event, command, application
keyword: file
library: Common library, library
message: startup, openBackground, preOpenStack, openStack, preOpenCard
Compatibility and Support
Introduced
LiveCode 2.0
OS
mac
windows
linux
ios
android
Platforms
desktop
server
mobile